/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.crm.workflow.entity.WorkFlowNode
   Module Description   :

   Date Created      : 2009/11/25
   Original Author   : andy.chuang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.crm.workflow.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.yaodian100.core.admin.entity.User;
import com.yaodian100.core.common.entity.BaseEntity;
import com.yaodian100.core.common.entity.CommonEntity;

/**
 * @author andy.chuang
 *
 */
@Entity
@Table(name="CRM_WORKFLOW_NODE")
public class WorkFlowNode extends CommonEntity{
    /**
     * 
     */
    private static final long serialVersionUID = -8902484059467346692L;
    private String id;
    private String shortDesc;
    private WorkFlow workFlow;
    private WorkFlowNode parent;
    private List<WorkFlowNode> childs;
    private WorkFlowTask task;
    private String responser;
    private String responseGroup;
    private Boolean allowBackward;
    private Boolean needApprove=false;
    private String approver;
    private String approveGroup;
    private String beApprovedGroup;
    private Boolean callOut=false;
    /**
     * @return the beApprovedGroup
     */
    public String getBeApprovedGroup() {
        return beApprovedGroup;
    }

    /**
     * @param beApprovedGroup the beApprovedGroup to set
     */
    public void setBeApprovedGroup(String beApprovedGroup) {
        this.beApprovedGroup = beApprovedGroup;
    }

	/**
     * @return the responseGroup
     */
    public String getResponseGroup() {
        return responseGroup;
    }

    /**
     * @param responseGroup the responseGroup to set
     */
    public void setResponseGroup(String responseGroup) {
        this.responseGroup = responseGroup;
    }

    /**
     * @return the approveGroup
     */
    public String getApproveGroup() {
        return approveGroup;
    }

    /**
     * @param approveGroup the approveGroup to set
     */
    public void setApproveGroup(String approveGroup) {
        this.approveGroup = approveGroup;
    }

	/**
	 * @return the callOut
	 */
	public Boolean getCallOut() {
	    return callOut;
	}

	/**
	 * @param callOut the callOut to set
	 */
	public void setCallOut(Boolean callOut) {
	    this.callOut = callOut;
	}
    /**
     * @return the approver
     */
    public String getApprover() {
        return approver;
    }

    /**
     * @param approver the approver to set
     */
    public void setApprover(String approver) {
        this.approver = approver;
    }

    /**
     * @return the needApprove
     */
    public Boolean getNeedApprove() {
        return needApprove;
    }

    /**
     * @param needApprove the needApprove to set
     */
    public void setNeedApprove(Boolean needApprove) {
        this.needApprove = needApprove;
    }

    /**
     * @return the allowBackward
     */
    public Boolean getAllowBackward() {
        return allowBackward;
    }

    /**
     * @param allowBackward the allowBackward to set
     */
    public void setAllowBackward(Boolean allowBackward) {
        this.allowBackward = allowBackward;
    }

    /**
     * @return the shortDesc
     */
    @Column(length=100)
    public String getShortDesc() {
        return shortDesc;
    }

    /**
     * @param shortDesc the shortDesc to set
     */
    public void setShortDesc(String shortDesc) {
        this.shortDesc = shortDesc;
    }

    /**
     * @return the responser
     */
    @Column(length=255)
    public String getResponser() {
        return responser;
    }

    /**
     * @param responser the responser to set
     */
    public void setResponser(String responser) {
        this.responser = responser;
    }

    /**
     * @return the task
     */
    @ManyToOne
    public WorkFlowTask getTask() {
        return task;
    }

    /**
     * @param task the task to set
     */
    public void setTask(WorkFlowTask task) {
        this.task = task;
    }


    /**
     * @return the parent
     */
    @ManyToOne
    public WorkFlowNode getParent() {
        return parent;
    }

    /**
     * @param parent the parent to set
     */
    public void setParent(WorkFlowNode parent) {
        this.parent = parent;
    }

    /**
     * @return the childs
     */
    @OneToMany(targetEntity=WorkFlowNode.class,mappedBy="parent")
    public List<WorkFlowNode> getChilds() {
        return childs;
    }

    /**
     * @param childs the childs to set
     */
    public void setChilds(List<WorkFlowNode> childs) {
        this.childs = childs;
    }

    /**
     * @return the workFlow
     */
    @ManyToOne
    public WorkFlow getWorkFlow() {
        return workFlow;
    }

    /**
     * @param workFlow the workFlow to set
     */
    public void setWorkFlow(WorkFlow workFlow) {
        this.workFlow = workFlow;
    }

    /**
     * @return the id
     */
    @Id
    @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name="system-uuid", strategy="uuid")
    @Column(length=32)
    public String getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }
    
//    private String 
}
